namespace Digitalmes.Domain.Sys;

/// <summary>
/// 角色表
/// </summary>
[SugarTable("sys_role", "角色表")]
public class SysRole : EntityTenantBase, IDeletedFilter
{
    /// <summary>
    /// 角色名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "角色名称", Length = 32)]
    public string? Name { get; set; }

    /// <summary>
    /// 角色父节点
    /// </summary>
    [SugarColumn(ColumnDescription = "分类名称")]
    public long ParentId { get; set; }

    /// <summary>
    /// 父节点集合
    /// </summary>
    [SugarColumn(ColumnDescription = "父节点集合", IsJson = true, Length = 512)]
    public List<long> ParentIdList { get; set; } = new();

    /// <summary>
    /// 角色层级
    /// </summary>
    [SugarColumn(ColumnDescription = "角色层级")]
    public int Layer { get; set; } = 1;

    /// <summary>
    /// 角色编号
    /// </summary>
    [SugarColumn(ColumnDescription = "角色编号", Length = 8)]
    public string? Number { get; set; }

    /// <summary>
    /// 是否超级管理员
    /// </summary>
    [SugarColumn(ColumnDescription = "是否超级管理员")]
    public bool IsSystem { get; set; }

    /// <summary>
    /// 状态， 默认为 true
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public bool Status { get; set; } = true;

    /// <summary>
    /// 角色设置最大数量，0为不限制
    /// </summary>
    [SugarColumn(ColumnDescription = "角色设置最大数量, 0为不限制")]
    public int MaxLength { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int Sort { get; set; } = 1;

    /// <summary>
    /// 描述
    /// </summary>
    [SugarColumn(ColumnDescription = "描述", Length = 256)]
    public string? Summary { get; set; }

    /// <summary>
    /// 控制台
    /// </summary>
    [SugarColumn(ColumnDescription = "控制台", Length = 32)]
    public string? Console { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(ColumnDescription = "是否删除")]
    public bool IsDel { get; set; }
}